﻿//跳转url，并且附加跟踪参数
function TransferToUrl(url) {
    url = AppendTransfers(url);
    window.location = url;
}

//将url附加跟踪参数
function AppendTransfers(url) {
    var objTransfers = $(".Transfers").val();
    if (objTransfers && objTransfers != "") {
        if (url.indexOf("?") > 0) {
            url = url + "&" + objTransfers;
        } else {
            url = url + "?" + objTransfers;
        }
    }
    return url;
}

//新窗口打开预览图
function OpenImagePreview(e) {
    if (e.src.indexOf("data:image") >= 0) {
        alert("预览选中图无法查看");
    } else {
        window.open(e.src, 'newwindow', 'height=540,width=900,top=120,left=150,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
        //window.open(e.src, 'newwindow', 'left=150,top=120');
    }
}

//创建iframe
function CreateiFrame(url, id, name) {
    var pro = "";
    if (id) {
        pro += "id=" + id;
    }
    if (name) {
        pro += " name=" + name;
    }
    return "<iframe " + pro + " scrolling=\"auto\" frameborder=\"0\" src=\"" + url + "\" style=\"width: 100%; height: 100%;\"></iframe>";
}